#pragma once
#include "Control.h"


class CLabel : public CControl
{
public:
	CLabel(LPCTSTR szName, CControl* pParent);
	virtual ~CLabel(void);

public:
	virtual void AddControl(CControl*);
	virtual void OnPaint(CPainter&);

private:
	class _CAppearance : public IAppearance
	{
	public:
		_CAppearance(CLabel*);
		virtual ~_CAppearance(void);
		virtual void SetSize(INT, INT);
		virtual Size GetSize(void) const;
		virtual const Region* GetShape(void) const;
		virtual BOOL GetVisibleRegion(Region*) const;
		virtual UINT BeginPaint(const Region*);
		virtual void EndPaint(UINT);
		virtual void Rendering(void);
		virtual void Rendering(CPainter&);
		virtual void Draw(IAppearance*, const Point&);
		virtual Graphics* GetGraphics(void);
		virtual BOOL HitTest(const Point&);

	private:
		CLabel*		m_pMyCtrl;
		Region		m_rgnShape;
		Region		m_rgnVisible;
		Size		m_size;

		std::vector<std::unique_ptr<Region>>	m_rgnStack;

	} m_appearance;


public:
	_JIN_DECLARE_RUNTIMECLASS(RuntimeClass);
	static CControl* CreateLabel(LPCTSTR szName, CControl* pParent);
};
_JIN_REFLINK_RUNTIMECLASS(CLabel::RuntimeClass, CLabel);
